using System.Web.UI;

using OpenNetCommerce.Localization;

[assembly: TagPrefix("MettleSystems.dashCommerce.Controls", "dashCommerce")]
namespace MettleSystems.dashCommerce.Controls {

  [ToolboxData("<{0}:HelpLink ID=\"HelpLinkId\" runat=\"server\" />")]
  public class HelpLink : System.Web.UI.WebControls.HyperLink {

    protected override void Render(HtmlTextWriter writer) {
      if (!string.IsNullOrEmpty(this.ID) && this.Text.Length == 0) {
        string helpText = string.IsNullOrEmpty(LocalizationUtility.GetHelpText(this.ID)) ? LocalizationUtility.GetHelpText("noHelp") : LocalizationUtility.GetHelpText(this.ID);
        this.Attributes.Add("onmouseover", string.Format(Overlib.TOOLTIP, helpText));
        this.Attributes.Add("onmouseout", Overlib.MOUSEOUT);
      }
      base.Render(writer);
    }
  }
}
